import * as Loadable from 'react-loadable';

import Loading from './Loading';
import { RouteComponentProps } from 'react-router';

interface Route {
    //路由
    path: string,
    //精准匹配
    exact?: boolean,
    //页面
    component: React.ComponentType<RouteComponentProps> | React.ComponentType,
    //是否登录
    auth?: boolean,
}

const routerConfig: Route[] = [
    {
        path: "/",
        exact: true,
        component: Loadable({
            loader: () => import('../pages/Home'),
            loading: Loading,
        }),
        auth: true,
    },
    {
        path: "/user/Archite",
        exact: true,
        component: Loadable({
            loader: () => import('../pages/user/Archite'),
            loading: Loading,
        }),
        auth: true,
    },
    {
        path: "/user/list",
        exact: true,
        component: Loadable({
            loader: () => import('../pages/user/List'),
            loading: Loading,
        }),
        auth: true,
    },
    {
        path: "/user/Info",
        exact: true,
        component: Loadable({
            loader: () => import('../pages/user/Info'),
            loading: Loading,
        }),
        auth: true,
    },
    {
        path: "/user/AssetsLog",
        exact: true,
        component: Loadable({
            loader: () => import('../pages/user/AssetsLog'),
            loading: Loading,
        }),
        auth: true,
    },
    {
        path: "/login",
        exact: true,
        component: Loadable({
            loader: () => import('../pages/Login'),
            loading: Loading,
        }),
    },
    {
        path: "/money/recharge",
        exact: true,
        component: Loadable({
            loader: () => import('../pages/money/Recharge'),
            loading: Loading,
        }),
        auth: true,
    },
    {
        path: "/money/Withdrawal",
        exact: true,
        component: Loadable({
            loader: () => import('../pages/money/Withdrawal'),
            loading: Loading,
        }),
        auth: true,
    },
    {
        path: "/setting/Advanced",
        exact: true,
        component: Loadable({
            loader: () => import('../pages/setting/Advanced'),
            loading: Loading,
        }),
        auth: true,
    },
];




export default routerConfig;